home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 February / EnigmA AMIGA RUN 34 (1999)(G.R. Edizioni)(IT)[!][issue 1999-02].iso / earcd / -recent3 / whdigamess-t.lzh / games / Starglider2.lha / starglider2-install / Install next >
Text File  |  1999-01-10  |  3KB  |  142 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "install.slave")    ;files to delete after install
  5. (set #last-file "Starglider2")    ;last file whdload should create
  6.  
  7. ;****************************
  8.  
  9. ;----------------------------
  10. ; Checks if given program is reachable via the path
  11. ; if not abort install
  12. ; IN:  #program - to check
  13. ; OUT: -
  14.  
  15. (procedure P_chkrun
  16.   (if
  17.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  18.     ("")
  19.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  20.   )
  21. )
  22.  
  23. ;****************************
  24.  
  25. (if
  26.   (exists #readme-file)
  27.   (if
  28.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  29.     ("")
  30.     (run ("SYS:Utilities/More %s" #readme-file))
  31.   )
  32. )
  33.  
  34. (set #program "WHDLoad")
  35. (P_chkrun)
  36.  
  37. (set @default-dest
  38.   (askdir
  39.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  40.     (help @askdir-help)
  41.     (default "RAM:")
  42.     (disk)
  43.   )
  44. )
  45. (set #dest (tackon @default-dest @app-name))
  46. (if
  47.   (exists #dest)
  48.   (
  49.     (set #choice
  50.       (askbool
  51.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  52.         (default 1)
  53.         (choices "Delete" "Skip")
  54.         (help @askbool-help)
  55.       )
  56.     )
  57.     (if
  58.       (= #choice 1)
  59.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  60.     )
  61.   )
  62. )
  63. (makedir #dest
  64.   (help @makedir-help)
  65.   (infos)
  66. )
  67.  
  68. ;----------------------------
  69.  
  70. (copyfiles
  71.   (help @copyfiles-help)
  72.   (source ("%s.slave" @app-name))
  73.   (dest #dest)
  74. )
  75. (copyfiles
  76.   (help @copyfiles-help)
  77.   (source "install.slave")
  78.   (dest #dest)
  79. )
  80. (if
  81.   (exists ("%s.newicon" @app-name))
  82.   (set #icon
  83.     (askchoice
  84.       (prompt "\nWhich icon do you like to install ?\n")
  85.       (default 0)
  86.       (choices "Normal" "NewIcon")
  87.       (help @askchoice-help)
  88.     )
  89.   )
  90.   (set #icon 0)
  91. )
  92. (select #icon
  93.   (set #icon ("%s.inf" @app-name))
  94.   (set #icon ("%s.newicon" @app-name))
  95. )
  96. (copyfiles
  97.   (help @copyfiles-help)
  98.   (source #icon)
  99.   (newname ("%s.info" @app-name))
  100.   (dest #dest)
  101. )
  102. (if
  103.   (exists #readme-file)
  104.   (copyfiles
  105.     (help @copyfiles-help)
  106.     (source #readme-file)
  107.     (dest #dest)
  108.   )
  109. )
  110. (if
  111.   (exists ("%s.info" #readme-file))
  112.   (copyfiles
  113.     (help @copyfiles-help)
  114.     (source ("%s.info" #readme-file))
  115.     (dest #dest)
  116.   )
  117. )
  118. (if
  119.   (= #sub-dir "")
  120.   ("")
  121.   (
  122.     (makedir #dest
  123.       (help @makedir-help)
  124.     )
  125.   )
  126. )
  127.  
  128. (run ("cd \"%s\"\nwhdload install.slave WriteDelay=50" #dest))
  129.  
  130. (if
  131.   (exists (tackon #dest #last-file))
  132.   ("")
  133.   (abort "The Install was unable to create all nesseccary files !")
  134. )
  135.  
  136. ;----------------------------
  137.  
  138. (run ("cd %s\nDelete %s ALL QUIET FORCE" #dest #cleanup))
  139.  
  140. (exit)
  141.  
  142.